home *** CD-ROM | disk | FTP | other *** search
- Path: ecf2.puc.edu!bivey
- From: bivey@ecf2.puc.edu (Bruce Ivey)
- Newsgroups: comp.lang.c
- Subject: Re: random number generator
- Date: 25 Jan 1996 03:43:48 GMT
- Organization: CRL Dialup Internet Access
- Message-ID: <4e6u9k$ntc@nntp.crl.com>
- References: <4e5rgd$631@ns.campus.mci.net>
- NNTP-Posting-Host: ecf2.puc.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jack Wilson (wilsojt@occ-uky.campus.mci.net) wrote:
- : Hello All!!! I am in need of a true random number generator in C...or
- : C++...I am modifying a program to do a random audit for 2000 items to be
- : audited. I have been looking for a rnd # gen. and haven't had much luck.
- : If anyone out there would have the source and wouldn;t mind sharing it I
- : would be grateful. Please e-mail me at
- : wilsojt@occ-uky.campus.mci.net...thanks in advance...Jack
-
- It would help if you said what system/compiler you are running. If you
- are using Borland C/C++, their random() function seems to be quite good,
- as determined by the simple tests (chi square, scattergram pairs, and so
- on). Haven't checked it using anything fancier.
-
- Do NOT use rand()--the Borland version has a period of only 232, or some
- such!.
-
- In general, check Knuth's _Seminumerical Algorithms_ or any of several
- books with canned code.
-
- Good luck.
-
- Bruce
-
-